package com.acme.entity.security;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.springframework.security.core.GrantedAuthority;

import com.acme.entity.User;

@Entity
@Table(name="Authorities")
public class UserAuthority implements GrantedAuthority
	{
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id @GeneratedValue
	@Column(name = "id")
	private int authID;
	
	@Column(name="role")
	private String authority;
	
	@ManyToOne
	@JoinColumn(name="userId")
	private User user;
	
	UserAuthority() {}
	
	public String getAuthority()
		{
		return authority;
		}

	public void setAuthority(String authority)
		{
		this.authority = authority;
		}

	public int getAuthID()
		{
		return authID;
		}

	public void setAuthID(int authID)
		{
		this.authID = authID;
		}
	}